home *** CD-ROM | disk | FTP | other *** search
- Path: surfnet.nl!sun4nl!xs4all!falstaff
- From: falstaff@xs4all.nl (Falstaff)
- Newsgroups: comp.lang.c
- Subject: Re: Problem with Watcom C++ 10.5
- Date: 10 Mar 1996 09:07:43 GMT
- Organization: XS4ALL, networking for the masses
- Message-ID: <4hu64v$60u@news.xs4all.nl>
- References: <31426ACB.6AA1@scsn.net>
- NNTP-Posting-Host: xs1.xs4all.nl
- X-Newsreader: NN version 6.5.0 #666 (NOV)
-
- Michael <mdorsey@scsn.net> writes:
-
- >I'm having a rather strange problem with Watcom C. When using functions
- >that output to stdout (ie printf()), it is not flushing to the screen
- >until a newline is sent. For example:
-
- >void main(void)
- >{
- > printf("Hit Y for yes, N for no: ");
- > yn();
- >}
-
- >yn() gets the key stroke and prints yes or no. The problem is that the
- >statement will not be printed until the newline from the answer is sent.
-
- Yup, that's normal for many libraries. Buffering is there for you, to
- make the program faster.
-
- >Kind of hard to answer a question if you can't see it. I can get around
- >it by flushing stdout after printf(), but I was kind of hoping there was
- >some type of variable I could set to turn off buffering of stdout.
-
- How about setvbuf()? See K&R p. 243.
-
- Frank
- --
- The famous GIICM now on line: http://www.xs4all.nl/~falstaff/GIICM.html
- ------------------------------------------------------------------------
- Frank A. Vorstenbosch +31-(70)-355 5241 falstaff@xs4all.nl
-